<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <ul id="main">
    <li>文本1</li>
    <li>文本2</li>
    <li>文本3</li>
  </ul>
  <a href="http:www.mianshiting.com" id="link">面试厅</a>
</body>
</html>

<script>
  //删除元素
  let main = document.querySelector("#main");
  let firstChild = main.firstElementChild;
  main.removeChild(firstChild);
  //删除a标签的href属性
  let link = document.querySelector("#link")
  link.removeAttribute("href")

  //删除文本节点1
  let last_Child = main.lastElementChild;
  // let testNode = last_Child.childNodes[0]  
  // last_Child.removeChild(testNode)
  //删除节点的方法2
  last_Child.innerHTML ="";//推荐

</script>